package com.nan.hrm;

import com.nan.hrm.domain.LoginUser;
import com.nan.hrm.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;
//LoginUserClient 表示对那个接口进行托底处理
@Component
public class LoginUserClientHystrixFallbackFactory implements FallbackFactory<LoginUserClient>{
    @Override
    public LoginUserClient create(Throwable throwable) {
        return new LoginUserClient() {
            @Override
            public AjaxResult addOrUpdate(LoginUser loginUser) {
                System.out.println("系统出错！！");
                return null;
            }
        };
    }
}
